﻿using System;
using UnityEngine;

public class GameResources
{
    public static T Get<T>() where T: UnityEngine.Object
    {
        return Resources.Load<T>(typeof(T).Name);
    }

    public static T Get<T>(string name) where T: UnityEngine.Object
    {
        return Resources.Load<T>(name);
    }

    public static ErrorMark ErrorMark
    {
        get
        {
            return Get<ErrorMark>("ErrorMark");
        }
    }

    public static UnityEngine.GUISkin GUISkin
    {
        get
        {
            return Get<UnityEngine.GUISkin>("GUISkin");
        }
    }

    public static GameObject HumanoidCharacter
    {
        get
        {
            return Get<GameObject>("HumanoidCharacter");
        }
    }

    public static TextMesh NameText
    {
        get
        {
            return Get<TextMesh>("NameText");
        }
    }

    public static Material OutlineMaterial
    {
        get
        {
            return Get<Material>("Outline");
        }
    }

    public static Player Player
    {
        get
        {
            return Get<Player>();
        }
    }

    public static PlayerCamera PlayerCamera
    {
        get
        {
            return Get<PlayerCamera>("PlayerCamera");
        }
    }

    public static PlayerCharacter PlayerCharacter
    {
        get
        {
            return Get<PlayerCharacter>();
        }
    }

    public static SeeThroughTrigger SeeThroughTrigger
    {
        get
        {
            return Get<SeeThroughTrigger>();
        }
    }

    public static GameObject UIHUD
    {
        get
        {
            return Get<GameObject>("UIHUD");
        }
    }

    public class Effects
    {
        public static Effect Get(string name)
        {
            return Resources.Load<Effect>("Effects/" + name);
        }

        public static T Get<T>(string name) where T: UnityEngine.Object
        {
            return Resources.Load<T>("Effects/" + name);
        }

        public static Effect ButtonClick
        {
            get
            {
                return Get("ButtonClick");
            }
        }

        public static Effect ButtonSelect
        {
            get
            {
                return Get("ButtonSelect");
            }
        }

        public static Effect Damage
        {
            get
            {
                return Get("Damage");
            }
        }

        public static HpChangingText HpChangingText
        {
            get
            {
                return Get<HpChangingText>("HpChangingText");
            }
        }

        public static Effect ObjectBreak
        {
            get
            {
                return Get("ObjectBreak");
            }
        }

        public static Effect Pickup
        {
            get
            {
                return Get("Pickup");
            }
        }
    }
}

